<!DOCTYPE html>
<html>
<head>
    <title>广告修改</title>
    {{template "inc/mate.html" .}}
    {{template "inc/easyui_css.html" .}}
    {{template "inc/ie_supper.html" .}}
</head>
<body>
	<form id="ff" method="post" action="{{.baseUrl}}/man/advert/up" class="easyui-form" data-options="novalidate:true,ajax:false" style="padding:30px 45px;">
		<div style="margin-bottom:20px; margin-left: -30px; margin-top: -30px">
	        <a href="{{.baseUrl}}/man/advert" class="easyui-linkbutton" style="width:100px;">返回列表</a>
	    </div>
	     <div style="margin-bottom:20px;">
		    <fieldset style="border-width: 1px 0px 0px 0px; margin-left: -30px;">
		    	<legend>修改广告信息</legend>
		    </fieldset>
            <input type="hidden" name="id" value="{{.advert.AdvertId}}" />
		</div>
		<div style="margin-bottom:20px"><!---->
            <input class="easyui-textbox" name="adTitle" data-options="label:'广告标题：',required:true" style="width:70%;" value="{{.advert.AdTitle}}" />
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="adUrl" data-options="label:'链接地址：',required:true,validType:'url'" style="width:70%;" value="{{.advert.AdUrl}}" />
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-numberspinner" id="adCSPrice" value="{{.advert.AdCSPrice}}" name="adCSPrice" data-options="label:'点击价格',increment:0.01,min:0.01,suffix:'$ ',required:true,precision:2"  style="width:180px;">
            <span></span>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input class="easyui-numberspinner" id="adTCount" value="{{.advert.AdTCount}}" name="adTCount" data-options="label:'推广次数',increment:1,min:1,required:true"  style="width:180px;">
        </div>
		<div style="margin-bottom:20px">
        	<a href="javascript:void(0)" class="easyui-linkbutton" id="btn_submit" style="width:100px; border-color: #4cae4c; background-image: linear-gradient(rgb(76,174,76) 0px, rgb(68,157,68) 100%);">修改广告</a>
        	<a href="javascript:void(0)" class="easyui-linkbutton" id="btn_clear" style="width:100px;">重新填写</a>
        </div>
        {{if .msg}}
            <div style="margin-bottom:20px; font-weight: bold; font-size: 36px; color: red;">
                {{.msg}}
            </div>
        {{end}}
	</form>
</body>
</html>
{{template "inc/easyui_js.html" .}}
<script type="text/javascript" src="{{.staticResourceUrl}}/js/easyui_validate.js"></script>
<script type="text/javascript" charset="UTF-8">
	$(document).ready(function(){
		var allHeight=document.documentElement.clientHeight;
		allHeight-=20;
		document.body.style.height = allHeight+"px";

		$("#btn_submit").click(function(){
            $('#ff').form('submit',{
                onSubmit:function(){
                    if ($(this).form('enableValidation').form('validate')){
                    	//adCSPrice adTCount
                    	var count=parseInt($("#adTCount").val());
                    	var price=parseFloat($("#adCSPrice").val());
                    	var total_price=count*price;

                    	var chose_res=confirm('此广告需要给代理的费用是'+total_price);
                    	
                    	return chose_res;
                    }else{
                    	return false;
                    }
                }
            });
        });
        $("#btn_clear").click(function(){
            $("#ff").form({
                novalidate:true
            });
            $("#ff").form("clear");
        });
    });
</script>